﻿using System;
using System.IO.Ports;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using NetController.MMA7455L;

namespace NetController
{
    public class Program
    {
        public static void Main()
        {
            //var botao = new InputPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled);

            // Instância e configura porta
            var porta = new SerialPort("COM1", 4800, Parity.None, 8);
            porta.Open();

            // Instância acelerômetro
            int leituraEixo;
            var acelerometro = new AcelMMA7455L();
            acelerometro.SetModeControl(new AcelMMA7455L.Configuration(Mode.Measurement, GLVL.Graus2));
            acelerometro.SetOffset();
            acelerometro.ReadAxis(AxisBits.X10, out leituraEixo);
        }
    }
}
